import apiClient from './api'

export async function getBookings(params = {}) {
  const response = await apiClient.get('/bookings', { params })
  return response.data
}

export async function getBooking(id) {
  const response = await apiClient.get(`/bookings/${id}`)
  return response.data
}

export async function createBooking(bookingData) {
  const response = await apiClient.post('/bookings', bookingData)
  return response.data
}

export async function updateBooking(id, bookingData) {
  const response = await apiClient.put(`/bookings/${id}`, bookingData)
  return response.data
}

export async function deleteBooking(id) {
  const response = await apiClient.delete(`/bookings/${id}`)
  return response.data
}

export async function checkAvailability(data) {
  const response = await apiClient.post('/bookings/check-availability', data)
  return response.data
}
